# products = [("牛奶",5),("鸡蛋",20),("香蕉",10),("杯子",10)]
# shopping_list = []
# money = float(input("请输入你的购物资金"))
# while True:
#     print("*"*30)
#     print("商品列表如下:")
#     for index,product in enumerate(products):
#         print(f"{index+1},商品:{product[0]},价格:{product[1]}")
#     print("*"*30)
#     option = input("请输入您要购买的商品(退出请键入q):")
#     if option.isdigit():
#         option = int(option)
#         if 0 <= option-1 < len(products):
#             option_product = products[option - 1]
#             if option_product[1] <= money:
#                 shopping_list.append(option_product)
#                 money -= option_product[1]
#                 print("购买成功！")
#             else:
#                 print(f"您的余额不足，余额为: {money}")
#         else:
#             print("您选的商品不存在！")
#     elif option == "q":
#         print("-" * 10,"购买清单", "-" * 10)
#         for item in shopping_list:
#             print(f"已购商品:{item[0]},价格:{item[1]}")
#         print("您的余额为:", money)
#         break
#     else:
#         print("您的输入不合法！")


# 排序
# age_list=[16,17,18,15,13]
# age_list.sort(reverse=True)
# print(age_list)


# 提出偶数
# s=[2,45,86,96,74,85,55]
# a=[]
# for i in s:
#     if i%2==0:
#         a.append(i)
# print(a)


# age=[14,13,8,17,11,9]
# age.sort(reverse=True)
# print(age)

# age=[14,13,8,17,11,9]
# new_age=sorted(age,reverse=True)
# print(age)
# print(new_age)

# a=[18,19,20,22,24,23,26]
# b=[]
# for i in a:
#     if i%2==0:
#         b.append(i)
# print(b)


# qq={"lyk":"双子座","czx":"金牛座","***":"处女座"}
# for i in qq.items():
#     print(i)
# for i,j in qq.items():
#     print(i,j)
# for i in qq.keys():
#     print(i)
# for i in qq.values():
#     print(i)



#垃圾回收
# waste_dict={
#     "可回收垃圾":["玻璃","金属","塑料瓶","纸张","衣服"],
#     "干垃圾":["餐巾纸","塑料袋","纸巾","纸尿裤","花盆","陶瓷"],
#     "湿垃圾":["剩饭剩菜","瓜皮果核","花卉绿植","过期零食"],
#     "有害垃圾":["电池","油漆桶","荧光灯管","废药品"]
# }
# while True:
#     search_waste=input("请输入你要查询的垃圾")
#     find = False
#     for classify,waste in waste_dict.items():
#         if search_waste in waste:
#             find = True
#             print(f"{search_waste}的类型是{classify}")
#             print("-"*30)
#     if search_waste=="q":
#         break
#     if find == False:
#         print("没有找到该垃圾的分类，请自行判断")
#         for classify,waste in waste_dict.items():
#             print(f"{classify}包括:{waste}")
#         print("-" * 30)
#         while True:
#             option = input("您是否希望将此垃圾加入到现有分类中呢(yes/no)?")
#             if option == "yes":
#                 classify = input("您希望将垃圾加入到那个类别呢？")
#                 waste_dict[classify].append(search_waste)
#                 break
#             elif option == "no":
#                 print("可以继续查询垃圾分类")
#                 break
#             else:
#                 print("您的输入有误，请重新输入")
